<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" name="" id="demo">
    <input type="text" name="" id="demo1" onchange="test">
    <script>
        document.querySelector('#demo').addEventListener('change',function(){
            console.log('打印');
        })
function test(){
    console.log('这是另一种开始');
}
        // document.querySelector('#demo1').onchange=test
    </script>
</body>
</html>